﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <include file="../inc/meta.inc" />
    <title>管理员</title>

</head>

<body>
    <div id="app" v-cloak>
        <div class="toolsbar">
            <btngroup show="新增,修改,删除" ref='btngroup' @delete="deleteData" path="EmployeeModify" width="600" height="600"
                :selects='selects' idkey='Acc_Id' table="datatables"></btngroup>
            <query_panel :model="form" :loading="loading" @search="handleCurrentChange(1)">
                <el-form-item label="">
                    <el-input v-model="form.name" clearable placeholder="名称" style="width:100px"></el-input>
                </el-form-item>
            </query_panel>
        </div>
        <template>
            <el-table ref="datatables" :data="accounts" :stripe="true" tooltip-effect="dark" style="width: 100%"
                @selection-change="val=>selects=val" @row-dblclick="rowdblclick">
                <el-table-column type="selection" width="55">
                </el-table-column>
                <el-table-column label="姓名/账号">
                    <template slot-scope="scope">
                        <span v-if="scope.row.Acc_Sex=='1'" class="man" icon="&#xe645" title="男性"></span>
                        <span v-if="scope.row.Acc_Sex=='2'" class="woman" icon="&#xe647" title="女性"></span>
                        <span v-html='showsearch(scope.row.Acc_Name,form.name)'></span>/ {{ scope.row.Acc_AccName }}
                    </template>
                </el-table-column>
                <el-table-column label="电话" width="120">
                    <template slot-scope="scope">
                        <span v-html='scope.row.Acc_MobileTel'></span>
                    </template>
                </el-table-column>
                <el-table-column prop="Posi_Name" label="岗位" show-overflow-tooltip width="120">
                    <template slot-scope="scope">{{scope.row.Posi_Name}}
                        <span class="el-icon-s-custom red" v-show='scope.row.isAdminPosi' title="系统管理岗"></span>
                    </template>
                </el-table-column>
                <el-table-column label="启用" width="80" align="center">
                    <template slot-scope="scope">
                        <span class="el-icon-loading" v-show="loadingid==scope.row.Acc_Id"></span>
                        <el-switch v-model="scope.row.Acc_IsUse" :disabled='scope.row.isAdminPosi'
                            @change="changeUse(scope.row)" v-show="loadingid!=scope.row.Acc_Id">
                        </el-switch>
                    </template>
                </el-table-column>
                <el-table-column label="密码" width="80" align="center">
                    <template slot-scope="scope">
                        <el-link type="primary" plain icon="el-icon-edit"
                            @click="$refs.btngroup.pagebox('EmployeePwreset?id='+scope.row.Acc_Id,'密码重置','EmployeePwreset_'+scope.row.Acc_Id)">
                            重置</el-link>
                    </template>
                </el-table-column>
                <el-table-column label="操作" show-overflow-tooltip width="120">

                    <el-button-group slot-scope="scope">
                        <el-link type="primary" plain icon="el-icon-edit"
                            @click='$refs.btngroup.modify(scope.row.Acc_Id)'>修改</el-link>
                        <el-tooltip class="item" effect="dark" :content="scope.row.isAdminPosi ? '系统管理员，不得删除' : ''"
                            :disabled='!scope.row.isAdminPosi' placement="left">

                            <el-popconfirm confirm-button-text='是的' cancel-button-text='不用' icon="el-icon-info"
                                icon-color="red" title="确定删除吗？" @confirm="$refs.btngroup.delete(scope.row.Acc_Id)">
                                <el-link type="danger" plain icon="el-icon-delete" :disabled='scope.row.isAdminPosi'
                                    slot="reference">删除
                                </el-link>
                            </el-popconfirm>


                    </el-button-group>

                </el-table-column>
            </el-table>

        </template>
        <div id="pager-box">
            <el-pagination v-on:current-change="handleCurrentChange" :current-page="form.index" :page-sizes="[1]"
                :page-size="form.size" :pager-count="12" layout="total, prev, pager, next, jumper" :total="total">
            </el-pagination>
        </div>
    </div>


</body>

</html>